UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ue3c9Cjuy3Sf85md5OmLJOUILHV1KVoeJDSW9Uj1llA='
WHERE
key_id = 'ecc926ea1fe60594657a763650f6a8473907706cf3279ae6c58737c22280c91f'
AND (
token = 'Ue3c9Cjuy3Sf85md5OmLJOUILHV1KVoeJDSW9Uj1llA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)