UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '74rsHZ4W+2F1IeXisQvlTC5LPIal9GcmskAJT6zuX8E=' 
WHERE 
  key_id = '81a07d6af059c75632818538b3dcabfb5361c37836b816d1c5fdac0be68aeb16' 
  AND (
    token = '74rsHZ4W+2F1IeXisQvlTC5LPIal9GcmskAJT6zuX8E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023