UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '90u6n0Jv66ajGOgwGhK7VrBGjQQYe7dQlR54v3OMU3A='
WHERE
key_id = 'c367057bebedb84bd803f2f3e476b82efc3ae0c1d0402e50b57f3ccc08038ddc'
AND (
token = '90u6n0Jv66ajGOgwGhK7VrBGjQQYe7dQlR54v3OMU3A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)