UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ip6qa9jkj/kDR9s2Hp736u0YW1XOtGku18Yl7l2+IUE='
WHERE
key_id = 'a5a90c333ba3bd82cd89490117334d5219ddcbf85a9f379e28b018cb9cd530bf'
AND (
token = 'Ip6qa9jkj/kDR9s2Hp736u0YW1XOtGku18Yl7l2+IUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)