UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nvPmJRF0fmRoTb0tBTzgnom6yfbobhI2L+dPvNT2gj0='
WHERE
key_id = 'bdbc079b58ccb5d3b33c0afff17af2c8c64ecbb0c2dd29628bcdfabc835f0d3a'
AND (
token = 'nvPmJRF0fmRoTb0tBTzgnom6yfbobhI2L+dPvNT2gj0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)