UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qFg92eU4fbQH7jTImFPe8WwC90j4snsHalCzSMbAwAE='
WHERE
key_id = '21b908c9b962c46c2228cf13d6f42f8516e9d0c4ae04eda55703bf4bdb84777c'
AND (
token = 'qFg92eU4fbQH7jTImFPe8WwC90j4snsHalCzSMbAwAE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)