UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0CsoTxj30NkmirPZGpMdaLqojuQDTiIm0aZzfF1p9Aw='
WHERE
key_id = 'ad221e33b5bad0b916ed11466fe247628a07acb86aff18f72bde7e71938ad54b'
AND (
token = '0CsoTxj30NkmirPZGpMdaLqojuQDTiIm0aZzfF1p9Aw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)