UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yEI+P/wkramToADSdC1xewTZefuVwq/Zcg5Zib/wlCk='
WHERE
key_id = '45a7c44f3867bc5f874bcabf041dfe32264372c46b2c8632946f9560c54e4d18'
AND (
token = 'yEI+P/wkramToADSdC1xewTZefuVwq/Zcg5Zib/wlCk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)