UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kE9RAdbljd4e5Xrv33hqZlP7oNsbclfxIDZ2rCBhyAM='
WHERE
key_id = '48ff11acb57005b340c43edd20144f696b3873102f5251ce9b0819fa7720754c'
AND (
token = 'kE9RAdbljd4e5Xrv33hqZlP7oNsbclfxIDZ2rCBhyAM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)