UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1qO5v0U2Ya8o1LW5iuNILLbdM4c00Kz4dFpJQj2ErrU=' 
WHERE 
  key_id = '64580f25c19d24c0b223bd90a325bc9a4a767ef2a47f59c4a7f8206898294ffa' 
  AND (
    token = '1qO5v0U2Ya8o1LW5iuNILLbdM4c00Kz4dFpJQj2ErrU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027