UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uxAjMWLRgPQinNeJ20VDr+zEGZoCGecbR98vs3bbEaQ=' 
WHERE 
  key_id = 'fb4f1c70f7c6402f8acc2f2db56735243d9203e8ae31e86a36b21fe87665aa02' 
  AND (
    token = 'uxAjMWLRgPQinNeJ20VDr+zEGZoCGecbR98vs3bbEaQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032