UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TH2Rtm0w0ZacmXsREADgALloWCE/5XmWKK3RGQVCFFA='
WHERE
key_id = '546bf5cdde3716e355c8e628b724d748a218411d971abb3ebbfd1c05553340b1'
AND (
token = 'TH2Rtm0w0ZacmXsREADgALloWCE/5XmWKK3RGQVCFFA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)