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