UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WG9qTKiaUXwL5HbtfcV1v+yb5SeNGnpvKvm5NQho/DA='
WHERE
key_id = '488e27ff4cc9a2d2afc94504a250d97245ddd53163ddf871278254eddc5812d4'
AND (
token = 'WG9qTKiaUXwL5HbtfcV1v+yb5SeNGnpvKvm5NQho/DA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)