UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4xjCzopi517M6LtmI3V/Fr5aT2BTQbI942VFC38wml0=' 
WHERE 
  key_id = 'b70abd25a88bb0e6821745bb11685feec2c8740e7422fd71395a974e5da017c4' 
  AND (
    token = '4xjCzopi517M6LtmI3V/Fr5aT2BTQbI942VFC38wml0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045