UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ELp4UrIsIcbAi0w6ty+dxLzRVGd9F5Xp/4Sh2aioQck='
WHERE
key_id = 'a57dc676e8106e831941e3e1ad8ec3820bf01cdc15ea8c65bde6fa90150df5a4'
AND (
token = 'ELp4UrIsIcbAi0w6ty+dxLzRVGd9F5Xp/4Sh2aioQck='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)