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