UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rqblFSU82tjcv5ctOhIVjGod/GrSrQo4c7DXKVtNHE4='
WHERE
key_id = '7a09f3da023c141931c1a1630fc9ebce8aba47f1ac9253a6e508281475f5d182'
AND (
token = 'rqblFSU82tjcv5ctOhIVjGod/GrSrQo4c7DXKVtNHE4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)