UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UdZ20RkO60r9ia93AyxJu7N+orLoMJeIB33rcfc6Dxc=' 
WHERE 
  key_id = '0335551b4a97f3407ec3c5c0f9935af5ebeb04da708727f48d0f6ba296cea70a' 
  AND (
    token = 'UdZ20RkO60r9ia93AyxJu7N+orLoMJeIB33rcfc6Dxc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026