UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ktjpr++MKmm1khbqs70a88dpJia3i5+SnJxNiTc7fsE='
WHERE
key_id = 'ed8ecbdb65d923921543a203970ade6aff82e04a50a5debcef41efdd06e64d0e'
AND (
token = 'Ktjpr++MKmm1khbqs70a88dpJia3i5+SnJxNiTc7fsE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)