UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hUMw4NjSp61w1flA209u39dxMMIA+ughK/g8NH3ms8s='
WHERE
key_id = '5127387f780b111eb5ea0412ddbf0a7e89b0cd3b4c47e8fcaf21c0b3585f7315'
AND (
token = 'hUMw4NjSp61w1flA209u39dxMMIA+ughK/g8NH3ms8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)