UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DZAnAXAnX+HL62TM3HXks7AZpuNZ/VlZoIoMx45dX4I='
WHERE
key_id = 'd25559b87b3e66475e48d136445eb827cbed027623c9b8d6cef8d5d22e0c5188'
AND (
token = 'DZAnAXAnX+HL62TM3HXks7AZpuNZ/VlZoIoMx45dX4I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)