UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'utFOqaaMZzsa0RM27r8gRlIYEipf1+Oq810azzUVRNE='
WHERE
key_id = '48d986b719225990216fc68117c60641ee9850a0c4e9aaa5a3614feffe74715a'
AND (
token = 'utFOqaaMZzsa0RM27r8gRlIYEipf1+Oq810azzUVRNE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)