UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8tXjWmClVwMU5m1IQJmId/Wnh6gHCp4rGiQFiDz3Bwg='
WHERE
key_id = 'ec3910e7ae2359e26bed3e0db28320a8b405c734cf89cef505ef8067c56d6ead'
AND (
token = '8tXjWmClVwMU5m1IQJmId/Wnh6gHCp4rGiQFiDz3Bwg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)