UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6et2RsGqGil7F9+W9qjv5ZhPZM+yqBtwwgme0+gH85o='
WHERE
key_id = 'ffc9018ef6b01d38edbb17e7eb2479a762da37d8cf1d0f46d7824a9b0c4d7076'
AND (
token = '6et2RsGqGil7F9+W9qjv5ZhPZM+yqBtwwgme0+gH85o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)