UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+aPeIERhNGqK+DLdhy+Yw+Ippz2wVOF9S5j/mjtNz4g='
WHERE
key_id = 'c8e42a5aa6d8925e206cb2fa8967bdd1871bceb32c144cc77b9a191b793a7dca'
AND (
token = '+aPeIERhNGqK+DLdhy+Yw+Ippz2wVOF9S5j/mjtNz4g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)