UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0mmNYGV61e5WQ/PIdLuEafvD3eXr3KI1Gs6fiE2iSH0='
WHERE
key_id = '0b6497ba6c075d2d74e0eb14d581ded9132355ebb964582b8ef0face37d13689'
AND (
token = '0mmNYGV61e5WQ/PIdLuEafvD3eXr3KI1Gs6fiE2iSH0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)