UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eIJqKHjE4CgQYqu8R3U+nrfHqSXQOmWaBeIkK01cxrY='
WHERE
key_id = '09c44d034fd4032db3d865e3b8daf0e5ac58de09ca22b7bcb213bb1e4be0c9b1'
AND (
token = 'eIJqKHjE4CgQYqu8R3U+nrfHqSXQOmWaBeIkK01cxrY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)