UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xpzK9XituwHWSlLkS5Dj/7QyLA4kHo8yybW/maPiVDY='
WHERE
key_id = '31bd73cd185824d2733bc26b251aaaf83d7bad81e3d8200de8ba2eb74ee1fd77'
AND (
token = 'xpzK9XituwHWSlLkS5Dj/7QyLA4kHo8yybW/maPiVDY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)