UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2W7oyaQpYuk8asSVgspIViffosyDH22J6JfQ89mcpI8='
WHERE
key_id = '0bc1821b10f4a4e15ebfb31bdb2c134aa2084dc5254f1c8a4c793e68382ecd6c'
AND (
token = '2W7oyaQpYuk8asSVgspIViffosyDH22J6JfQ89mcpI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)