UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GSQKe1GVrX+e5NjzcJjPB6PX9wPOIJS7fIR2H6j6zl4=' 
WHERE 
  key_id = '7813812a4cde971aebed2eace8dc89f42c99f262e76c694365a90d14db727051' 
  AND (
    token = 'GSQKe1GVrX+e5NjzcJjPB6PX9wPOIJS7fIR2H6j6zl4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036