UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ua4TnbfxE4Q24F1WXB1b+T4wBH3UOSAQU27mpUFxKHY='
WHERE
key_id = '04152aa67831b45e6b937dae2f52c0dc95b801820d632937ed1c1ae127f0978c'
AND (
token = 'ua4TnbfxE4Q24F1WXB1b+T4wBH3UOSAQU27mpUFxKHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)