UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '18ZxHzf7yVMkYgmn4BmMP3UDfNWpGShwGGXmX12Vcyw='
WHERE
key_id = '3cd2db7d63116655fb8d41f1938c619720d648befaca7ebfacb5836b504c527d'
AND (
token = '18ZxHzf7yVMkYgmn4BmMP3UDfNWpGShwGGXmX12Vcyw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)