UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'URb00EUp1BtVpxqYTMtDTZkiNEf4+mNHvzbZAU0sYXM='
WHERE
key_id = '6751ac458f5aebf166abaede9a944eb60c4c39b9a6d37693936ff5eae7800bb1'
AND (
token = 'URb00EUp1BtVpxqYTMtDTZkiNEf4+mNHvzbZAU0sYXM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)