UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4TxLwJkUpBbhU3AkF3IOu3amWLffrIaw7ZLUpQBtWw8=' 
WHERE 
  key_id = '95299d57295a6bf38df8f2639ee4d4d1865802feb9aee1f4fec2439150cbab01' 
  AND (
    token = '4TxLwJkUpBbhU3AkF3IOu3amWLffrIaw7ZLUpQBtWw8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055