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

Query time 0.00051