UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SxyuSzkSDnxyjS6zISUUq3ltqK4USTAf7CRmlpRbaEI='
WHERE
key_id = '21617b7f440dc27acb575c4aa5801f7bce45f7ed0cff2582d58953520cb9f158'
AND (
token = 'SxyuSzkSDnxyjS6zISUUq3ltqK4USTAf7CRmlpRbaEI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)