UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i44DtU9UCN6Bik/7kn1+2fQkhfcdDMOXwObJt0j8aTo='
WHERE
key_id = 'dd3428d50b8de9485be7777cc3093369b3d37f80752132d50f65ef521a2c360a'
AND (
token = 'i44DtU9UCN6Bik/7kn1+2fQkhfcdDMOXwObJt0j8aTo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)