UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gEqTzmIiphP+I4lnYBU6qfVX0c2V7oQy3WFNc7MysmQ='
WHERE
key_id = 'cfb739b9b275f52665200ae2007a6af1b6875c2a80591c18e67708897f27ca68'
AND (
token = 'gEqTzmIiphP+I4lnYBU6qfVX0c2V7oQy3WFNc7MysmQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)