UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lyFOU3akyJ9pOu5khVQTiu5ixrLWlVLZUQqgWojfd2Q=' 
WHERE 
  key_id = 'c8e7a47f53514b438106f1e9aaa873398c2a76b96d0fd2731735a01bd38ddcb9' 
  AND (
    token = 'lyFOU3akyJ9pOu5khVQTiu5ixrLWlVLZUQqgWojfd2Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039