UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jxTM++R5mgOHV/XgvkqlvOMZT74IkWt4qC42u13bxgk='
WHERE
key_id = 'b9c590eddca90e44fe8d28b66f102777d9ce9507f13b8bb89571f5ddb89b2d52'
AND (
token = 'jxTM++R5mgOHV/XgvkqlvOMZT74IkWt4qC42u13bxgk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)