UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'djoApVgAlHUwQcVjAypNG4m/ktaLZxBRMhIoDAO2VMo=' 
WHERE 
  key_id = '0dda2852bd3d9be86ecca5118dd1e70cceb80cb27f0fb972e5a38eff23ff6736' 
  AND (
    token = 'djoApVgAlHUwQcVjAypNG4m/ktaLZxBRMhIoDAO2VMo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038