UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/XTdKU6OrU7pcFDMRts4DxO9xMyM5+PKeK/v1zpxrp8='
WHERE
key_id = '555bdbc2dc9953d437ecaf353dcf374b8886c3c385b815a126e0f505b7250f5e'
AND (
token = '/XTdKU6OrU7pcFDMRts4DxO9xMyM5+PKeK/v1zpxrp8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)