UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EvpiTXOlQ/MslN3Txn15UWuu2YY52hAQGkzm1/5oaZ8=' 
WHERE 
  key_id = '5f114efa17de963b08e0f67c5ae43c2eb073a107e235ad167d08b28bb87a6faa' 
  AND (
    token = 'EvpiTXOlQ/MslN3Txn15UWuu2YY52hAQGkzm1/5oaZ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044