UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iH4CBfDyhzfguTCd1gDKBb7CT7RpZP3ghp6fVxlK1n4='
WHERE
key_id = 'e82db17ed4bf9a2d03ed41a72cafe9d3fd3f09e2f7e402a1baa81b2567305e6e'
AND (
token = 'iH4CBfDyhzfguTCd1gDKBb7CT7RpZP3ghp6fVxlK1n4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)