UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ILLUgXM+rGj4jqXmKdAzL3vHZl+nhF2s7p2Qm0bzsKU=' 
WHERE 
  key_id = 'b11c1eea780d727be45b1a4d4a41a43f3ef425378380bb079dc8cdafe2ba5171' 
  AND (
    token = 'ILLUgXM+rGj4jqXmKdAzL3vHZl+nhF2s7p2Qm0bzsKU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023