UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/MIiAcpZrW5tvhrlmqJVdXo9TT8dyOkvbzSO9oDRNls='
WHERE
key_id = 'bc0fcc22a50414f5578850779593e74364fef9d18571138cb7bf5ef7b9d55f45'
AND (
token = '/MIiAcpZrW5tvhrlmqJVdXo9TT8dyOkvbzSO9oDRNls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)