UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BZfA0c5WolabyDkcGueKGFcSbLnpIq0xBLkbSg7oUP4='
WHERE
key_id = '108d837332580774f167382aa49e6975f9be9512246d8ded81387f110a1f909b'
AND (
token = 'BZfA0c5WolabyDkcGueKGFcSbLnpIq0xBLkbSg7oUP4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)