UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MjfhNDEnP3iGeCvbRFDv9dVtx6rQ+QctZrCHDpKkWoo=' 
WHERE 
  key_id = 'ac337087a21335842f4c5673cc081bcddcb8b0b9c34553c0939851ab065eaccb' 
  AND (
    token = 'MjfhNDEnP3iGeCvbRFDv9dVtx6rQ+QctZrCHDpKkWoo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019