UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MxOq6+FNnQwOFxlWmfYhLpuDJ3Zrttygb3G2yDCRZN0=' 
WHERE 
  key_id = '56666ddaf0538df63dfafc744c8194e2ce84e7fdb97d1f395864d25a8c57f198' 
  AND (
    token = 'MxOq6+FNnQwOFxlWmfYhLpuDJ3Zrttygb3G2yDCRZN0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019