UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DP4aAz0zxsNUhmm8RAVvSqYlvGQdpPjSYTIseeCAZJk='
WHERE
key_id = '319ff90ed3e4147d3db149c7bae7861186763a7cedb9c9c578dd800f38e531cf'
AND (
token = 'DP4aAz0zxsNUhmm8RAVvSqYlvGQdpPjSYTIseeCAZJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)