UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I5vRoBKhwXZYkoCiMy4WIDhbKjVj1wNm7K+gEt9FSRo='
WHERE
key_id = '7a1cf6df72f0584def25af5f66cdcd92cfbe5afd504ee7066bee89cb06798505'
AND (
token = 'I5vRoBKhwXZYkoCiMy4WIDhbKjVj1wNm7K+gEt9FSRo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)