UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uj00zYy4o9/PjA/0t5Ht50+8LrLmrgZDy2ZyfefkRn0='
WHERE
key_id = 'd7861babf66f9739ce6e53ef14e09c80c0f535fa3bc2efb4772af277b4e827ae'
AND (
token = 'Uj00zYy4o9/PjA/0t5Ht50+8LrLmrgZDy2ZyfefkRn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)